#include <stdio.h>

int main()
{
    int a;
    int b;
    char c;
    printf("please input a:");
    scanf("%d", &a);
    printf("please input b:");
    scanf("%d", &b);
    printf("please input c:");
    getchar();//把调用scanf时候用户输入的回车吃掉
    c = getchar();
    printf("a = %d, b = %d, c = %c\n", a, b, c);

    if (c == '+')
    {
        printf("%d\n", a + b);
    }
    else if (c == '-')
    {
        printf("%d\n", a - b);
    }
    else if (c == '*')
    {
        printf("%d\n", a * b); 
    }
    else if (c == '/')
    {
        if (b != 0)
        {
            printf("%f\n", (double)a / b);
        }
        else
        {
            printf("b = 0 error\n");
        }
    }
    else
    {
        printf("input error\n");
    }
    return 0;
}

